// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Author: wsfuyibing <682805@qq.com>
// Date: 2024-08-15

package main

import (
    "gitee.com/go-wares/framework-iris/framework"
    "gitee.com/go-wares/log"
    "gitee.com/go-wares/mqx/app/annotations"
)

func main() {
    // Send all logs
    // to adapter before application end. It's configured by config/log.yml.
    defer log.Close()

    // Create
    // iris web framework.
    fw := framework.New()
    defer fw.Run()

    // Add
    // annotations to application.
    fw.Application.AddAnnotationControllers(annotations.AnnotationControllers...)
    fw.Application.AddAnnotationCrontabs(annotations.AnnotationCrontabs...)
    fw.Application.AddAnnotationHandlers(annotations.AnnotationHandlers...)
    fw.Application.AddAnnotationMiddlewares(annotations.AnnotationMiddlewares)

    // Parallel runner.
    // fw.Application.AddParallels(func(ctx context.Context) {
    //     x.New().Process().Start(ctx)
    // })
}
